import request from '../../utils/requestes'

enum API {
	CENTER = '/userCenter/users/me?access_token=b274c872-4c0b-476a-9ec4-3a93861296ce&use=update',
	MEMBERS = '/setup/setups/search/findByGroupType?access_token=b274c872-4c0b-476a-9ec4-3a93861296ce&groupType=vip_product',
	SKILLS = '/setup/setups/search/findByGroupType?groupType=skill_level&access_token=b274c872-4c0b-476a-9ec4-3a93861296ce',
	AVOCATION = `/avocation/avocations/rec/user?access_token=b274c872-4c0b-476a-9ec4-3a93861296ce&`,
	SEARCH = '/avocation/avocations/search/findByName?access_token=b274c872-4c0b-476a-9ec4-3a93861296ce&name=',
	SAVE = '/userCenter/users/ff80808183d5a6440183e9df981b153a?access_token=b274c872-4c0b-476a-9ec4-3a93861296ce',
}

// 获取个人信息
export const reqGetCenter = () => request.get<any, any>(API.CENTER)

// 获取会员信息
export const reqGetMembers = () => request.get<any, any>(API.MEMBERS)

// 获取技能信息
export const reqGetSkills = () => request.get<any, any>(API.SKILLS)

// 获取爱好信息
export const reqGetAvocation = (pageNum: any) =>
	request.get<any, any>(API.AVOCATION + `pageNum=${pageNum}&pageSize=20`)

// 搜索爱好
export const reqGetSearch = (searchName: any) =>
	request.get(API.SEARCH + searchName)

// 保存按钮
export const reqSaveInfo = (data) => request.patch(API.SAVE, data)
